cvl (response, penalized, unpenalized, lambda1 = 0, lambda2 = 0,
positive = FALSE, data,
model = c("cox", "logistic", "linear", "poisson"), startbeta,
startgamma, fold, epsilon = 1e-10, maxiter, standardize = FALSE,
trace = TRUE, approximate = FALSE)
optL1 (response, penalized, unpenalized, minlambda1, maxlambda1,
base1, lambda2 = 0, positive = FALSE, data,
model = c("cox", "logistic", "linear", "poisson"), startbeta,
startgamma, fold, epsilon = 1e-10, maxiter = Inf,
standardize = FALSE, tol = .Machine$double.eps^0.25, trace = TRUE)
optL2 (response, penalized, unpenalized, lambda1 = 0, minlambda2,
maxlambda2, base2, positive = FALSE, data,
model = c("cox", "logistic", "linear", "poisson"), startbeta,
startgamma, fold, epsilon = 1e-10, maxiter, standardize = FALSE,
tol = .Machine$double.eps^0.25, trace = TRUE, approximate = FALSE)
profL1 (response, penalized, unpenalized, minlambda1, maxlambda1,
base1, lambda2 = 0, positive = FALSE, data,
model = c("cox", "logistic", "linear", "poisson"), startbeta,
startgamma, fold, epsilon = 1e-10, maxiter = Inf,
standardize = FALSE, steps = 100, minsteps = steps/2, log = FALSE,
save.predictions = FALSE, trace = TRUE, plot = FALSE)
profL2 (response, penalized, unpenalized, lambda1 = 0, minlambda2,
maxlambda2, base2, positive = FALSE, data,
model = c("cox", "logistic", "linear", "poisson"), startbeta,
startgamma, fold, epsilon = 1e-10, maxiter, standardize = FALSE,
steps = 100, minsteps = steps/2, log = TRUE, save.predictions = FALSE,
trace = TRUE, plot = FALSE, approximate = FALSE)Surv object for Cox regression and factor or a vector of 0/1 values for logistic regression.formula object. See also under data.penalized. Note that an unpenalized intercept is included in the model by default (except in the cox model). This can be suppressed by specifying unpenalized = ~0.penalized argument. In the latter case, each covariate is given ibase1*minlambda1 and base1*maxlambda1; analogous for base2.TRUE, constrains the estimated regression coefficients of all penalized covariates to be non-negative. If a logical vector with the length of the number of covariates in penalized, constrains the estimated regression coefficiedata.frame used to evaluate response, and the terms of penalized or unpenalized when these have been specified as a formula object.response input.lambda1 and lambda2.lambda1 and lambda2.n vector with values in 1:fold, specifying exactly which subjects are assigned to whicglm. Convergence is judged separately on the likelihood and on the penalty.TRUE, standardizes all penalized covariates to unit central L2-norm before applying penalization.minlambda1 and maxlambda1 or minlambda2 and maxlambda2 at which the cross-validated likelihood is to be calculated.minlambda1 and maxlambda1 or minlambda2 and maxlambda2 at which the cross-validated likelihood is to be calculated. If minsteps is smaller than stepFALSE, the steps between minlambda1 and maxlambda1 or minlambda2 and maxlambda2 are equidistant on a linear scale, if TRUE on a logarithmic scale. Please note the different doptimize.TRUE, prints progress information. Note that setting trace=TRUE may slow down the algorithm (but it often feels quicker)TRUE, the cross-validated likelihood values are approximated rather than fully calculated. Note that this option is only available for ridge models.TRUE, makes a plot of cross-validated likelihood versus lambda.penalized, penfit, plotpath.# More examples in the package vignette:
# type vignette("penalized")
data(nki70)
attach(nki70)
# Finding an optimal cross-validated likelihood
opt <- optL1(Surv(time, event), penalized = nki70[,8:77], fold = 10)
coefficients(opt$fullfit)
plot(opt$predictions)
# Plotting the profile of the cross-validated likelihood
prof <- profL1(Surv(time, event), penalized = nki70[,8:77],
fold = opt$fold, steps=20)
plot(prof$lambda, prof$cvl, type="l")
plotpath(prof$fullfit)Run the code above in your browser using DataLab